'use strict'
const port = process.env.port || process.env.npm_config_port || 9527 // dev port
module.exports = {
    publicPath: './',
    productionSourceMap: false, //是都生成map文件(作用是经过压缩和加密的),文件过大。建议false
    devServer: {
        port: port,
        open: false,
        overlay: {
            warnings: false,
            errors: true
        },
        proxy: {
            // change xxx-api/login => mock/login
            // detail: https://cli.vuejs.org/config/#devserver-proxy
            //配置多个代理
            '/api': {
                // target: `http://127.0.0.1:${port}/mock`,
                target: process.env.VUE_APP_BASE_API, //代理服务器地址
                changeOrigin: true, //允许跨域
                pathRewrite: { //代理路径，表示路径重写
                    ['^' + process.env.VUE_APP_BASE_API]: ''
                }
            }
        },
        // after: require('./mock/mock-server.js')
    }
}